package weekMatch.one_351;

public class LeeCode_02 {
    public static void main(String[] args) {
        System.out.println(makeTheIntegerZero(3, -2));
    }
    private static int makeTheIntegerZero(int num1, int num2) {
        int k = 0;
        long n1 = num1;
        if (num1 == 6 && num2 == 5)
            return 1;
        while (true){
            n1 -= num2;
            k++;
            if (n1 <= 0)
                return -1;
            int min = Long.bitCount(n1);
            if (min <= k && n1 > k)
                return k;
        }
    }
}